
public class Packet {
	
	public String appendHeader(String message) {
		String header = "Content-Length: " + message.length();
		String packet = header + "\r\n\r\n" + message;
		return packet;
	}
	
	public String generateRegister(String username, String password) {
		String message = "<talk_request><register userid=\"" + username + "\" password=\"" + password + "\"/></talk_request>";
		return message;
	}
	
	public String generateInvite(String to) {
		String message = "<talk_request><invite to=\"" + to + "\"/></talk_request>";
		return message;
	}
	
	public String generateCancel(String to) {
		String message = "<talk_request><cancel to=\"" + to + "\"/></talk_request>";
		return message;
	}
	
	public String generateAccept(String from) {
		String message = "<talk_request><accept from=\"" + from + "\"/></talk_request>";
		return message;
	}
	
	public String generateReject(String from) {
		String message = "<talk_request><reject from=\"" + from + "\"/></talk_request>";
		return message;
	}
	
	public String generateBye(String to) {
		String message = "<talk_request><bye to=\"" + to + "\"/></talk_request>";
		return message;
	}
}
